package com.cyf.db.mapper.ad;

import com.cyf.db.bean.ad.Ad;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created by hfy on 2017/5/16.
 */

public interface AdMapper {

    @Select("select * from ad where id = #{id}")
    Ad getById(@Param("id") Integer adId);

    @Update("update ad set inviteCodeId = #{inviteCodeId} where id = #{id}")
    void updateInviteCodeId(@Param("id") Integer id, @Param("inviteCodeId") Integer inviteCodeId);

    @Update("update ad set payStatus = 1, price = #{price} where id = #{id}")
    void updatePaySuccess(@Param("id") Integer id, @Param("price") int price);
}
